<template>
  <div class="box-bg">
    <div class="grid h-full grid-cols-3 gap-6">
      <div v-for="(item, index) in list" :key="index" class="data-card flex flex-col items-center justify-between">
        <div class="value-container">
          <div class="value">{{ item.value }}</div>
          <div class="value-label">{{ item.label }}</div>
        </div>
        <div class="icon-wrapper">
          <div class="hexagon-container">
            <div class="hexagon"></div>
            <div class="hexagon-glow"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { watch, ref } from 'vue';

// 明确声明 props
const props = defineProps({
  usageSituationData: {
    type: Array,
    default: () => [],
  },
});

let list = ref([])

watch(
  () => props.usageSituationData,
  (newVal) => {
    list.value = newVal;
  },
  { deep: true, immediate: true }
);
</script>


<style scoped lang="scss">
.box-bg {
  padding: 0 20px 20px 20px;
  height:570px;
}

.box {
  width: 100%;
  height: 100%;
  padding-top: 20px;
}

.data-card {
  background: rgba(16, 20, 38, 0.9);
  border: 2px solid #00a8ff;
  border-radius: 12px;
  padding: 20px 20px 30px 20px;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(0, 168, 255, 0.2);
  min-height: 180px;

  &:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.4);
    border-color: #00ffff;

    .hexagon {
      transform: scale(1.1) rotate(30deg);
    }

    .value {
      text-shadow: 0 0 15px rgba(0, 168, 255, 0.8);
    }
  }

  .value-container {
    text-align: center;
    width: 100%;
    z-index: 1;
  }

  .value {
    font-size: 40px;
    font-weight: bold;
    background: linear-gradient(45deg, #00a8ff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    transition: text-shadow 0.3s ease;
  }

  .value-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-top: 4px;
  }

  .icon-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  .hexagon-container {
    position: relative;
    width: 60px;
    height: 60px;
  }

  .hexagon {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #00a8ff, #00ffff);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.4s ease;
    position: relative;
    z-index: 1;
  }

  .hexagon-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #00a8ff, #00ffff);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    filter: blur(10px);
    opacity: 0.5;
    z-index: 0;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }

  50% {
    transform: scale(1.1) rotate(30deg);
    opacity: 0.8;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}
</style>
